package demo

import "fmt"

func GetBTCTotal() {
	//每21万个区块减半
	//最初始奖励50个
	//循环计算出比特币总量

	total := 0.00
	currentInit := 50.00
	blockInitVal := 21.00 //万
	count := 0
	for currentInit > 0 {
		count0 := blockInitVal * currentInit
		currentInit *= 0.5 //减半
		total += count0
		count++
	}
	fmt.Print("总数: ", total, "减半次数: ", count)

}
